<?php
class Application_Model_Base_Memory_Schema_MakeUp
{
	public static function makeUpKey($schema, $values)
	{
		foreach ($schema as $field)
		{
			if ($field['required'] == 1 && isset($values[$field['name']]))
			{
				return false;
			}
		}
		return true;
	}
	public static function makeUpField($schema, $value)
	{
		foreach ($values as $index => $currentValue)
		{
			$result = false;
			foreach ($schema as $field)
			{
				if ($index == $field['name'])
				{
					$result = true;
					$currentValue = self::_makeUpValue($field['type'],
							$currentValue);
					break;
				}
			}
			if ($result == false)
			{
				unset($value[$index]);
			}
		}
		return $value;
	}
	
	//TODO : covert $value to what have type is $type
	private static function _makeUpValue($type, $value)
	{
		switch ($type)
		{
			case 'string':
				return $value;
				break;
			case 'int':
				break;
		}
	}
}